package logic

import (
	"context"
	user "week41/common/proto"
	"week41/service/server"
)

type UserClient struct {
	user.UnimplementedUserServer
}

func (u UserClient) Login(ctx context.Context, in *user.LoginReq) (*user.LoginResp, error) {
	login, err := server.Login(in)
	if err != nil {
		return nil, err
	}
	return login, nil
}

func (u UserClient) Register(ctx context.Context, in *user.RegisterReq) (*user.RegisterResp, error) {
	login, err := server.Register(in)
	if err != nil {
		return nil, err
	}
	return login, nil
}

func (u UserClient) List(ctx context.Context, in *user.ListReq) (*user.ListResp, error) {
	login, err := server.List(in)
	if err != nil {
		return nil, err
	}
	return login, nil
}
